require(['mGlobal', 'slideShow'], function () {
	var webRoot = G_WEB_ROOT;
	var urls = {
		searchTxt: webRoot + '/m/searchTxt'
	};
	$('.slides').bxSlider({});


	function searchBox() {
		$("#searchTxtBtn").unbind().bind("click", function () {
			var keyword = $(".keyword").val();
			$.post(urls.searchTxt, { "searchTxt": keyword }, function (rs) {
				if (null != rs) {
					$("#Ks_mProductZone").empty();
					var html = "";
					$.each(rs, function (index, item) {
						html +=
						'<div class="incBox">'
						+'	<h3><a href="'+webRoot+'/m/productList?classifyId='+item[0].classifyId+'" class="more">查看更多商品 &gt;</a>'+item[0].classifyName+'</h3>'
						+'	<div class="productList">';
						$.each(item, function (index2, item2) {
							html +=
							'	<dl>'
							+'	<dd>'
							+'	<p class="img"><a href="'+webRoot+'/m/product?productId='+item2.id+'"><img src="'+webRoot+'/'+item2.imgPath+'" width="150" height="150"></a></p>'
							+'	<p class="name"><a href="'+webRoot+'/m/product?productId='+item2.id+'">'+item2.name+'</a></p>'
							+'	<p class="price showPrice">售价：￥${dto.price}元</p>'
							+'	<p class="price">月供：￥${dto.monthlyPayment}元</p>'
							+'	</dd>'
							+'	</dl>';
						});
						html+='</div></div>';
					});
					$("#Ks_mProductZone").append(html);
				}
			});
		});
	};
	searchBox();

});